using System;
using Npgsql;

namespace PTransaction
{

	public class DbConnection
	{
		private static DbConnection instance = new DbConnection();
		private static string connectionString;
		private NpgsqlConnection connection;
		
		
		private DbConnection ()
		{

		}

		public static string ConnectionString
		{
			set{connectionString = value;}
		}
		
		public static DbConnection Instance
		{
			get{return instance;}
		}
		
		public NpgsqlConnection Connection
		{
			get
			{
				if(connection == null)
				{
					connection = new NpgsqlConnection(connectionString);
					connection.Open();
				}
				return connection;
			}
		}
	}
}
